The present invention is generally related to graphical image manipulation systems, and more particularly to methods for compositing multiple graphical images.
A graphical image manipulation computer program, such as Adobe Photoshop 5.0, from Adobe Systems Incorporated, of San Jose, Calif., may store a graphical image as a set of image layers. Such a program builds a final image by compositing the image layers together. The image layers may be thought of as stacked sheets of acetate. The density of the ink on the acetate controls the transparency of the sheet, i.e., the extent to which the sheet obscures the underlying sheets. In the computer program, the color and density of the ink on the acetate sheet are represented by a color value and an opacity (or xe2x80x9calphaxe2x80x9d) value, respectively.
A conventional graphical image document includes a set of image layers, commonly denoted as layers 1, 2, . . . , n, organized in a layer stack. The bottom layer, i.e., layer 1, acts as the background or bottom sheet, whereas the other layers, i.e., layers 2, 3, . . . , n, act as the transparencies which are overlaid on the background.
Each image layer typically includes an image, an optional mask or masks, and compositing controls. Typically, the image is represented by an array of pixels, with each pixel having a color and, optionally, an opacity. Similarly, the mask is typically represented by an array of pixels, with each pixel having an opacity. However, the image and the mask could be defined analytically, e.g., by using shape outlines, or by other functions which define color and/or opacity as a function of position. In addition, the image and the mask can be dynamic, i.e., the data representing the image is computed at the time the layers are composited from the data in an underlying image layer or layers. For example, one or more layers in the document could be filter layers, adjustment layers, or layer effects.
The compositing controls may include a global opacity and a transfer mode. The global opacity controls, in essence, the transparency of the entire image layer, whereas the transfer mode determines how the colors in the image layer mix with the colors accumulated from the underlying layers. The compositing controls may also be considered to include dynamic masks.
The process of stacking the acetate sheets to form the final image is modeled by an accumulation buffer which stores a composited color for each pixel. The image layers are composited in order from bottom to top. Conventionally, the compositing process begins by calculating any dynamic data in the image layer, such as the color of the pixels in the image or the opacity of the pixels in the mask. Then the opacity of each pixel is determined from the mask, the global opacity, and, if appropriate, the image. Finally, the color of each pixel in the image layer is combined with the composited color of the corresponding pixel in the accumulation buffer to generate a new composited color. The combination is controlled by the opacity of the layer pixel and the transfer mode. This process is iterated for each layer until all the layers have been composited, thus generating the final image.
Some graphics manipulation programs permit the user to generate a group of layers, e.g., a clipping group, that share properties with a base layer, or to create adjustment layers, filter layers or layer effects that are attached to a layer. However, in both the conventional graphical image manipulation systems and the programs that permit layers to be clipped or attached to other layers, the order of composition of the layers is determined by their order in the stack. Unfortunately, there are some complex compositing effects for which it is difficult for a user to determine the proper order, attachment or grouping of the layers to achieve a desired visual appearance. In addition, there are some complex compositing effects that cannot be generated by merely combining image layers sequentially. An example of such a complex compositing effect is a layer that obscures its drop shadow but is partially opaque or has a non-normal blending mode. Another example is a layer that applies highlights and shadows to its interior using a normal blending mode but has a non-normal blending mode.
In one aspect, the invention is directed to a method of compositing a graphical image document having a plurality of layers. In the method, a class is stored for each layer of the plurality of layers, a compositing sequence for the plurality of layers is derived from the classes, and the plurality of layers are composited in the compositing sequence.
Implementations of the invention may include one or more of the following features. The document may include a first layer, user input may be received selecting a layer effect for the first layer, and a second layer may be generated from the layer effect. The layer effect may be selected from drop shadow, inner shadow, outer glow, inner glow, outer bevel, inner bevel, emboss, border, and border emboss. An association between a plurality of layer effects and a plurality of default classes may be stored, and the class may be selected from the plurality of default classes based on the layer effect. User input selecting a class for the second layer may be received. A compositing hierarchy may be stored, and each class may be associated with a position in the compositing hierarchy.
In another aspect, the invention may be directed to a method of compositing a first image that overlies an underlying image. The first image includes a plurality of effects. A plurality of second images are generated from the first image, the underlying image, and the plurality of layer effects, and the first image, the underlying image, and the plurality of second images are composited in a composition sequence determined by the plurality of layer effects.
Implementations of the invention may include one or more of the following features. Any cascade blend effects, e.g., overlay or inner glow, may be applied to the first image to generate a first intermediate image. Any base effects, e.g., drop shadows, may be applied to the underlying image to generate a second intermediate image. The first intermediate image may be composited with the second intermediate image according to a color blending mode of the first image to generate a third intermediate image. Any standard interior effects, e.g., inner shadows or inner glows, and post-border interior effects, e.g., inner bevels, may be applied to the third intermediate image to generate a fourth intermediate image. Any underlying effects, e.g., outer glows or drop shadows, and any exterior effects, e.g., outer bevels, may be applied to the second intermediate image to generate a fifth intermediate image. The fifth intermediate image may be cross-faded with the fourth intermediate image to generate a sixth intermediate image. An over effects, e.g., an emboss, may be applied to the sixth intermediate image to generate a seventh intermediate image. The underlying image may be cross-faded with the seventh intermediate image to generate a resulting image. The composition sequence may include at least one conditional branch.
In another aspect, the invention is directed to a method of compositing a first image that overlies an underlying image. The first image including a border effect and at least one other effect. A first intermediate image is derived from the first image, the underlying image, and zero or more first layer effects. A second intermediate image is derived from the underlying layer and the border effect. A third intermediate image is derived from the underlying layer and zero or more second layer effects. If the border effect is an inner border or the border effect is a center border and the at least other effect includes an inner bevel or an outer bevel, the first intermediate image is cross-faded with the second intermediate image to generate a fourth intermediate image. If the layer effects include an inner bevel, a fifth intermediate image is derived from one of the fourth intermediate and first intermediate images and the inner bevel. If the border effect is an outer border or the border effect is a center border and the at least other effect includes an inner bevel or an outer bevel, the third intermediate image is cross-faded with the second intermediate image to generate a sixth intermediate image. If the layer effects include an outer bevel, a seventh intermediate image is derived from one of the sixth intermediate image and the third intermediate image. The seventh intermediate image is cross-faded with the fifth intermediate image to generate an eighth intermediate image. If the border effect is a center border and the at least other effect does not include an inner bevel or an outer bevel, the eighth intermediate image is cross-faded with the second intermediate image to generate a ninth intermediate image. Zero or more fourth layer effects are applied to the ninth intermediate image to generate a tenth intermediate image, and the underlying image is cross-faded with the tenth intermediate image to generate an eleventh image.
In another aspect, the invention is directed to a method of compositing a layer in a graphical image document, the layer including a layer image. User input selecting a global opacity for the layer and an effect for the layer is received. A first image is generated from the effect, the initial state of the document, the first image and the layer image are composited to generate a second image, and the initial state of the document is cross-faded with the second image using the global opacity to generate a sixth image.
Implementations of the invention may include one or more of the following features. User input selecting a common mask may be received, and the cross-fading step may use the common mask to generate the sixth image.
In another aspect, the invention is directed to a method of compositing a layer in a graphical image document. The layer including a first image and at least one layer effect. User input is received selecting a non-normal color blending mode for the layer. An initial state of the document below the layer is composited with the first image according to the non-normal color blending mode to generate a second image. A third image from is generated the layer effect, an initial state of the document below the layer is composited with the third image to generate a fourth image, and the fourth image is cross-faded with the second image to generate a fifth image.
In another aspect, the invention is directed to a method of compositing a layer in a graphical image document. The layer includes a layer image and a border effect. A first image is derived from an initial state of the document below the layer, and a second image is derived from the border effect. The first image is composited with the second image to generate a third image, a fourth image is derived from the layer image, and the fourth image is cross-faded with the third image according to a border mask to generate a fifth image.
Possible advantages in implementations the invention may include one or more of the following. Complex compositing effects can be generated without requiring a complex user interface for the layering model. Layer opacity can be applied in a single step to the layer and the effects. A knockout of underlying effects can be performed even when the layer has a non-normal color blending mode or is partially opaque (a knockout is a compositing construct in which elements are blended against a background other than the current accumulation buffer and the result is cross-faded with the accumulation buffer through a shape mask). For example, a layer that obscures its drop shadow or other exterior effect can be generated even if the layer is partially opaque or uses a non-normal blending mode. Strokes can be generated that knockout the layer contents. Multi-modal clipping groups (a compositing construct in which elements are clipped to a base layer but in which color blending occurs separately) can be created. For example, bevel and emboss effects that are not contaminated by the color blending mode of the layer can be generated. A layer can be generated that applies highlights and shadows to its interior using a normal blending mode when the layer has a non-normal blending mode. Stroke, bevel and emboss effects can interact in a sophisticated fashion. Adjustment layers can be treated in a more formalized model.